function Person(){
    this.name = 'icoder'
    this.age = 18
    this.getAge = function(){
        return this.age
    }
}

const p1 = new Person()
const a = p1.getAge()//定义了一个成员属性的访问函数，直接调用函数访问


function Person(){
    this.name = 'icoder'
    this.age = 18
}
const p2 = new Person()
const b = p2.age//直接对属性名称进行访问